package com.luozhili.rabbitmqlearningdemo.spring_demo.simple_demo;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Sender {
    @Autowired
    RabbitTemplate rabbitTemplate;

    @RequestMapping("sendmsg")
    public void send(){
        rabbitTemplate.convertAndSend("topic_spring_learn_exchange","user.insert",new String("你好"));

    }


}
